import {GetCookie} from "../util";

function IsWeixinOrAlipay() {
  let ua = window.navigator.userAgent.toLowerCase()
  //判断是不是微信或者支付宝
  if (ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/AlipayClient/i) == 'alipayclient') return true
  //哪个都不是
  return false
}
let expName = IsWeixinOrAlipay();

let CONFIG = {
  baseUrl: document.URL.indexOf('huasth') !== -1 ? 'http://api.huasth.com/api/':'http://test.huasth.net/api/',
  appId:'2095690568',
  get token(){
    return GetCookie('token_')
  },
  get isVerified(){
    return localStorage.getItem('isVerified') || 0
  },
  get userType(){
    return   localStorage.getItem('userType') || 1
  },
  isWeixin:expName
};

export default CONFIG;
